import React, { Component } from 'react'
// import './Child1.css'
import styles from './Child1.module.css'

console.log('---child1 styles---', styles)

export default class Child1 extends Component {
  state = {
    isShow: true
  }

  render () {
    return (
      <div>
        {/* <p className='test'>Child1</p> */}

        {/* <p className={`${styles.test} ${styles.other}`}>Child1</p> */}
        {/* <p className={[styles.test, styles.other].join(' ')}>Child1</p> */}

        <p
          className={[styles.test, this.state.isShow ? styles.other : ''].join(
            ' '
          )}
        >
          Child1
        </p>
        <p>
          <button onClick={() => this.setState({ isShow: !this.state.isShow })}>
            toggle
          </button>
        </p>
      </div>
    )
  }
}
